import axios from './axios'
const SERVICE = process.env.VUE_APP_SERVICE_PORTAL.replace(/"/g, '')
// const FILE_SERVICE = process.env.VUE_APP_SERVICE_FILE_SERVICE.replace(/"/g, '')
// const SERVICE_FILE = process.env.VUE_APP_SERVICE_FILE

export function get (url, params) {
  // let finalUrl
  // if (url.indexOf(SERVICE_FILE) === 0) {
  //   finalUrl = `${FILE_SERVICE}${url}`
  // } else {
  //   finalUrl = `${SERVICE}${url}`
  // }
  // return axios.get(finalUrl, {params})
  return axios.get(`${SERVICE}${url}`, {params})
}

export function post (url, params, config) {
  // let finalUrl
  // if (url.indexOf(SERVICE_FILE) === 0) {
  //   finalUrl = `${FILE_SERVICE}${url}`
  // } else {
  //   finalUrl = `${SERVICE}${url}`
  // }
  // return axios.post(finalUrl, params, config)
  return axios.post(`${SERVICE}${url}`, params, config)
}
